package com.taiji.dicom4cloud.smart.service.impl;

import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.github.pagehelper.util.StringUtil;
import com.taiji.dicom4cloud.smart.dao.CameraEquipmentMapper;
import com.taiji.dicom4cloud.smart.model.entity.Camera;
import com.taiji.dicom4cloud.smart.service.CameraEquipmentService;
import org.springframework.stereotype.Service;


@Service
public class CameraEquipmentServiceImpI extends ServiceImpl<CameraEquipmentMapper, Camera> implements CameraEquipmentService   {


    @Override
    public Page getCameraEquipmentPage(Page page, Camera camera) {

        Page page1 = this.page(page, Wrappers.<Camera>lambdaQuery()
                .eq(StringUtil.isNotEmpty(camera.getOrgId())&&!camera.getOrgId().equals("-1"), Camera::getOrgId,camera.getOrgId())
                .like(StringUtil.isNotEmpty(camera.getCameraEquipmentName()),Camera::getCameraEquipmentName,camera.getCameraEquipmentName())
                .like(StringUtil.isNotEmpty(camera.getDeviceId()),Camera::getDeviceId,camera.getDeviceId()));


        return page1;
    }
}
